home *** CD-ROM | disk | FTP | other *** search
- ====================
- TExcel component 3.1
- ====================
- TExcel is a component to produce output tables directly into
- MS Excel, including formatting, commands, macro calls, etc.
-
- Demo project is attached to show how easy to drive it.
- The demo project creates the component explicitly so it can be
- tried without installing the component.
-
-
- Files:
- EXCELS.PAS Component source
- EXCEL.DCR Icon for Delphi 1.0
- EXCEL.D32 Icon for Delphi 2.0/3.0
- EXCELDEM.DPR Demo project
- EXCELDEM.RES Demo project resource
- EXCELTOP.PAS Demo dialog
- EXCELTOP.DFM Demo dialog format
- TEXCEL.XLS Demo Excel macro collection
- README.TXT This text
-
- Thanks to Stefan Hoffmeister the sophisticated version
- named TAdvExcel is available at the following sites:
- http://sunsite.icm.edu.pl/delphi/
- http://carbohyd.siobc.ras.ru/torry/
-
-
- ======================
- About GetCell function
- ======================
- Though TExcel is to produce output to Excel sometimes input is
- also needed. GetCell retrieves the contents of the specified cell.
- It opens a new DDE conversation to get the contents of the cell
- then resets the original DDE link. When many cells needed it is
- recommended to write an other method to make it more efficient.
-
-
- ===========================================
- About Wait procedure and WaitAfter property
- ===========================================
- Both needed when huge amount of data must be transferred to Excel.
- When a program transfers more thousands in a loop the DDE channel
- and Excel is not able to process them and a slow down happens.
- The process can be speeded up by using Wait and/or WaitAfter.
- The optimal speed is when the program transfers data
- on the same speed as Excel is able to process it.
-
- The Wait procedure waits for Excel to be ready and resets the
- transfer counter. Wait is automatically called when the number
- of transfers exceeds the value specified by WaitAfter.
- The appropriate WaitAfter value depends on the configuration
- and the amount of data to be transferred. The more data needs
- the smaller value. The Demo project helps to calibrate the
- WaitAfter value. Sometimes the calibration can double the speed
- especially on smaller machines where memory is the bottle neck.
-
- ==================
- Excel DDE commands
- ==================
- To tell the truth I have never seen documentations of Excel DDE
- commands but I have found that most of Excel 4.0 macro instructions
- work as DDE commands. So all you have to do make a macro using the
- desired instruction in Excel 4.0 format and use it as DDE command.
- (With Excel 5.0 you can record macro in 4.0 format.)
- The demo project shows some samples in the "Command" combo box.
-
-
- =================================================================
- Instead of documentation here are some words about the interface.
- =================================================================
-
- procedure Connect;
- To connect Excel.
-
- procedure Disconnect;
- To disconnect Excel.
-
- procedure Wait;
- To wait for Excel to be ready. See section "About Wait...".
-
- function Request(const Item: string): string;
- To request for a DDE item.
- Use "SysItems" to get the available items.
-
- procedure Exec(const Cmd : string);
- To execute Excel commands. See section "Excel DDE Commands".
-
- procedure Run(const Mn: string);
- To execute a macro of the open macro file.
-
- procedure Filter(const Txt: string); virtual;
- To replace the current cell with filtering.
-
- procedure Select(Row, Col: Integer);
- To select a cell of the active Excel sheet.
-
- procedure PutStr(Row, Col: Integer; const s: string);
- To replace the cell with string.
-
- procedure PutExt(Row, Col: Integer; e: Extended);
- To replace the cell with real number.
-
- procedure PutInt(Row, Col: Integer; i: Longint);
- To replace the cell with integer.
-
- procedure PutDay(Row, Col: Integer; d: TDateTime);
- To replace the cell with date value.
-
- function GetCell(Row, Col: Integer): string;
- To get the cell contents. See section "About GetCell".
-
- procedure OpenMacroFile(const Fn: TFileName; Hide: Boolean);
- To specify a macro file.
- Needed only when macros are going to call.
-
- procedure CloseMacroFile;
- To close an opened macro file.
- Only one macro file can be opened at the same time.
-
- procedure StartTable(Create: Boolean);
- To start sending data. It writes a warning message into
- cell (1,1), minimizes Excel and starts transfer counter.
-
- procedure EndTable;
- To finish the table. It clears the warning from
- cell (1,1) and bring up the result i.e. restore Excel.
-
- property DDE: TDdeCLientConv;
- To handle DDE directly. (Read only)
- Normally not needed.
-
- property Connected: Boolean;
- To check connection.
-
- property Ready: Boolean;
- To check Excel status. (Read only)
-
- property Selection: string;
- To get current selection. (Read only)
-
- property ExeName: TFileName;
- To set Excel path.
-
- property Decimals: Integer;
- To specify number format for real numbers.
-
- property Separator: Char;
- To specify decimal separator for real numbers.
-
- property WaitAfter: Integer;
- To calibrate waiting for Excel. See section "About Wait...".
-
- property OnClose: TNotifyEvent;
- Event handler called when Excel is connected.
-
- property OnOpen: TNotifyEvent;
- Event handler called when Excel is disconnected.
-
-
- --------------------------------------
- --------------------------------------
-
- If you find the component useful I want to hear about you!
-
- --------------------------------------
- --------------------------------------
- Tibor F. Liska MTA SZTAKI
- Lagymanyosi utca 11
- 1111 Budapest
- Hungary
- Fax: +36-1-209-5288
- Tel: +36-1-209-5284
- E-mail: liska@sztaki.hu